package cj.web.admin.dao;
/*
 *  
 *  
*/
import java.util.List;
import java.util.Map;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import net.paoding.rose.jade.annotation.SQLParam;
import cj.web.admin.domain.SurveyPeople;

/**
 * 
 * @author 
 *
 */
@DAO
public interface SurveyPeopleDAO{
	
	@SQL("SELECT id,surveyId,name,companyGroup,phone,score,createAt FROM SurveyPeople WHERE deleteFlag=1 AND surveyId=:t.surveyId #if(:t.name!=''){ AND name LIKE '%##(:t.name)%' } #if(:t.phone!=''){ AND phone LIKE '%##(:t.phone)%' } #if(:t.companyGroup!=''){ AND companyGroup LIKE '%##(:t.companyGroup)%' } ORDER BY updateAt DESC ")
    List<SurveyPeople> query(@SQLParam("t") SurveyPeople surveyPeople);
	
	@SQL("SELECT count(1) FROM SurveyPeople WHERE deleteFlag=1 AND surveyId=:1 ORDER BY id ")
    int querysize(int surveyId);
	
	@SQL("SELECT name,companyGroup,phone,score FROM SurveyPeople WHERE deleteFlag=1 AND surveyId=:1 ORDER BY id LIMIT :2,:3 ")
    List<Map> query(int surveyId,int start,int length);
}